#ifndef CHILD_SOCKET_WORKER_H
#define CHILD_SOCKET_WORKER_H
#include "include.h"

class child_socket_worker
{
public:
    child_socket_worker(uv_loop_t*,int);

    auto* getProcessHandle();
    auto* getReadPipeHandle();
    auto* getWritePipeHandle ();
    auto* getProcessOptionsHandle();
    auto* getStdioContainer();
    auto getNum();
    auto getPid();

    auto setExitCallback(uv_exit_cb);
    auto buildDefault();

    auto run();
    auto stop();
private:
    uv_loop_t *loop;
    uv_process_t process;
    uv_process_options_t process_options;
    uv_pipe_t piper,pipew;
    uv_stdio_container_t stdio_container[3];
    uv_exit_cb exitCallback;
    int num;
    pid_t pid;
    char *args[2];
};

#endif // CHILD_SOCKET_WORKER_H
